package cn.vonce.sqlbean.example.model.entity;

import cn.vonce.sql.annotation.*;
import cn.vonce.sql.enumerate.FillWith;
import cn.vonce.sqlbean.example.enums.UserStatus;
import cn.vonce.sqlbean.example.model.BaseEntity;
import lombok.Data;

/**
 * 用户
 *
 * @author Jovi
 * @email imjovi@qq.com
 * @date 2023/10/27 17:19
 */
@Data
@SqlTable(autoAlter = true, value = "t_user", remarks = "用户")
public class User extends BaseEntity {

    @SqlColumn(notNull = true, remarks = "用户名")
    private String userName;

    @SqlColumn(remarks = "姓名")
    private String nickName;

    @SqlColumn(notNull = true, remarks = "手机号码")
    private String mobilePhone;

    @SqlColumn(notNull = true, remarks = "密码")
    private String password;

    @SqlColumn(notNull = true, remarks = "性别")
    private Integer gender;

    @SqlColumn(remarks = "年龄")
    private Integer age;

    @SqlColumn(remarks = "电子邮箱")
    private String email;

    @SqlColumn(remarks = "头像", oldName = "head_portrait")
    private String avatar;

    @SqlDefaultValue(with = FillWith.INSERT)
    @SqlColumn(notNull = true, remarks = "状态(0正常 1停用)")
    private UserStatus status;

}